<?php
	if(!isset($_REQUEST['ajax'])){ $_REQUEST['ajax'] = "";}
	if($_REQUEST['ajax']!=true) include 'header.tpl.php';
	include 'project_panel.tpl.php';
?>
	<link href="resources/css/fileuploader.css" type="text/css" rel="stylesheet" />
	<div class="row">
		<div class="col-lg-12">
			<div class="panel">
				<div class="panel-heading">
					<div class="panel-title"><i class="icon-list"></i> <?php echo $this->language['project_create'];?></div>
				</div>
				<div class="panel-body">
					<form action="javascript:taoDuan();" class="form-horizontal">
						<?php if(isset($this->project)): ?>
						<input type="hidden" id="projectParent" name="projectParent" value="<?php echo $this->project['pId'];?>" />
						<div class="form-group">
							<label class="col-lg-2 control-label">Dự án Cha</label>
							<div class="col-lg-6">
								<input type="text" value="<?php echo $this->project['pName'];?>" disabled class="form-control" />
							</div>
						</div>
						<?php else: ?><input type="hidden" id="projectParent" name="projectParent" value="0" />
						<?php endif;?>
						<div class="form-group">
							<label class="col-lg-2 control-label"><?php echo $this->language['project_name'];?></label>
							<div class="col-lg-6">
								<input type="text" id="projectName" name="projectName" class="form-control" />
							</div>
						</div>
						<div class="form-group">
							<label class="col-lg-2 control-label"><?php echo $this->language['receiver'];?></label>
							<div class="col-lg-4">
								<select name="groupLeader" id="groupLeader" class="form-control">
									<option value="">Chọn trưởng nhóm..</option>
									<?php echo $this->secGroup;?>
								</select><br/>
								<select name="groupMember[]" id="groupMember" class="form-control" style="height:150px;" multiple>
									<?php echo $this->secGroup;?>
								</select>
							</div>
						</div>
						<div class="form-group">
							<label class="col-lg-2 control-label"><?php echo $this->language['project_start_date'];?></label>
							<div class="col-lg-2">
								<input type="text" id="projectStart" name="projectStart" class="form-control date_picker" />
							</div>
						</div>
						<div class="form-group">
							<label class="col-lg-2 control-label"><?php echo $this->language['project_end_date'];?></label>
							<div class="col-lg-2">
								<input type="text" id="projectDead" name="projectDead" class="form-control date_picker" />
							</div>
						</div>
						<div class="form-group">
							<label class="col-lg-2 control-label">Mã hợp đồng (nếu có)</label>
							<div class="col-lg-3">
								<input type="text" id="projectContract" name="projectContract" class="form-control" />
							</div>
						</div>
						<div class="form-group">
							<label class="col-lg-2 control-label"><?php echo $this->language['project_priority'];?></label>
							<div class="col-lg-2">
								<select name="uutien" id="uutien" class="form-control">
									<option value="3">Cao</option>
									<option value="2" selected>Bình thường</option>
									<option value="1">Thấp</option>
								</select>
							</div>
						</div>
						<div class="form-group">
							<label class="col-lg-2 control-label"><?php echo $this->language['attach_file'];?></label>
							<div class="col-lg-6">
								<div id="file-uploader"></div>
								<input type=hidden id="uploadfile" name="uploadfile" value="">
								<div id="uploaded"></div>
							</div>
						</div>
						<div class="form-group">
							<label class="col-lg-2 control-label"><?php echo $this->language['project_content'];?></label>
							<div class="col-lg-10">
								<textarea class="form-control wysiwyg" id="projectContent" name="projectContent" rows="5" wrap="off"></textarea>
							</div>
						</div>
						<div class="form-group">
							<div class="col-lg-offset-2 col-lg-10">
								<button type="submit" class="btn btn-primary"><?php echo $this->language['accept'];?></button>
								<button type="reset" class="btn btn-danger">Reset</button>
							</div>
						</div>
					</form>
				</div>
			</div>
		</div>
	</div>
	<script type="text/javascript" src="resources/scripts/jquery-ui.min.js"></script>
	<script type="text/javascript" src="resources/scripts/jquery.datePicker.js"></script>
	<script type="text/javascript" src="resources/scripts/jquery.wysiwyg.js"></script>
	<script type="text/javascript" src="resources/scripts/fileuploader.js"></script>
	<script>
	$(function() {
		$( "#projectStart" ).datepicker({dateFormat: 'dd-mm-yy'});
		$( "#projectDead" ).datepicker({dateFormat: 'dd-mm-yy'});
	});
	$(".wysiwyg").wysiwyg();
	var uploader = new qq.FileUploader({
		element: document.getElementById('file-uploader'),
		action: 'file.php?act=upload',
		debug: false
	});
	</script>
<?php if(isset($this->breadcrumb) && isset($this->title_header)):?>
	<script type="text/javascript">
		$(function() {
			$("#title-header").text('<?php echo $this->title_header;?>');
			$("#breadcrumb").html('<?php echo build_breadcrumb($this->breadcrumb);?>');
		});
	</script>
<?php endif;?>
<?php
	if($_REQUEST['ajax']!=true) include 'footer.tpl.php';
?>